package week07;
import static java.lang.System.out;
import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;

import java.io.IOException;
import java.util.Arrays;

public class Hello {
    public static void main(String[] args) throws IOException {
        SparkConf conf = new SparkConf().setMaster("local[*]").setAppName("HelloSpark");
        JavaSparkContext ctx = new JavaSparkContext(conf);
        JavaRDD<String> hello = ctx.parallelize(Arrays.asList("Hello,world","Hello Spark!","Hi,my first spark app.")) ;
        out.println(hello.collect());

        System.in.read();
        ctx.stop();
    }
}
